Skip to content

llvm: Add version 13.0.1 #183

Merged
merged 1 commit into from
Apr 19, 2022
Merged

llvm: Add version 13.0.1 #183

merged 1 commit into from
Apr 19, 2022

Conversation

niclas
Copy link
Contributor

@niclas niclas commented Mar 21, 2022

The version released in February 2022.

The version released in February 2022.
@donald
Copy link
Contributor

donald commented Apr 13, 2022

Installed and tested.

@niclas
Copy link
Contributor Author

niclas commented Apr 19, 2022

@donald why not merged then?

@donald donald merged commit c6d86a6 into master Apr 19, 2022

mkdir -p $PREFIX
cat >$PREFIX/profile <<-EOF
PATH=$PREFIX/bin:\$PATH
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From bash(1):

If the redirection operator is <<-, then all leading tab characters are stripped from input lines and the line containing delimiter. This allows here-documents within shell scripts to be indented in a natural fashion.

So tabs should be used.

@wwwutz
Copy link
Contributor

wwwutz commented May 23, 2022

Tabs are evil. Please don't use them. There is no standard concerning size, so using them rips intended formatting.

@niclas
Copy link
Contributor Author

niclas commented May 24, 2022

issue: bash broke <<- redirection operator. leading tabs get deleted.

next time I'll use sed to get rid of the spaces in the output if that is a deep concern.

@donald
Copy link
Contributor

donald commented May 25, 2022

" bash broke <<- redirection operator" is a funny way to say that you wrongly used space instead of tab. But I didn't catch it either.
Anyway, its no real problem, just four spaces at the beginning of the lines of the profile scripts in the llvm packages. We can live with that.

Probably caused by a smart editor converting between tabs and spaces on its own.

It makes sense to avoid this danger in the future by not indenting the HERE docs at all.

@niclas
Copy link
Contributor Author

niclas commented May 25, 2022

why not just use sed?

sed 's/^    //' > FILENAME <<EOF
    FILE
    CONTENT
        WANTED INDENTED
EOF
> cat FILENAME
FILE
CONTENT
    WANTED INDENTED

@donald
Copy link
Contributor

donald commented May 25, 2022

Same problem, if editor replaces a string of spaces by tabs on the "WANTED INDENTED" line.
How about

sed 's/\s*|//' >test.txt <<EOF
    |FILE
    |CONTENT
    |   WANTED INDENTED
EOF

Edit: Changed <<-EOF into <<EOF

@pmenzel
Copy link
Contributor

pmenzel commented May 25, 2022

No idea, why there were so many misunderstanding, and why it blew up. I just commented on a minor detail, so next time it can be avoided. Here-documents are pretty handy, and shorter than the sed hacks.

@niclas
Copy link
Contributor Author

niclas commented May 25, 2022

I agree on the style provided by Donald.

The problem is that there is no reason to use tabs and many against it. Furthermore, shorter but more error-prone in real life. Eleven characters can solve all the issues and being easy to read and understand. Also it's not an overall commitment, so feel free to use tabs in your scripts. You correctly mentioned my non-awareness of the <<- docs but I dislike the recommendation of that and therefore we discussed an alternative.

Sign in to join this conversation on GitHub.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants